package be.aquafin.klipdf.handlers;

import java.util.List;

import be.aquafin.klipdf.dao.DataDao;
import be.aquafin.klipdf.model.DataObject;
import be.aquafin.klipdf.model.Pipe;
import be.aquafin.klipdf.model.json.JSONObject;

public final class PipeHandler extends DataHandler {

	public PipeHandler(DataDao dataDao) {
		super(dataDao);
	}

	@Override
	protected List<? extends DataObject> getData(List<String> keys) {
		return dataDao.getPipes(keys);
	}

	@Override
	public JSONObject process(DataObject dataObject) {
		Pipe pipe = (Pipe) dataObject;
		JSONObject pipeJsonObject = new JSONObject();
		pipeJsonObject.put("uid", pipe.getUid());
		return pipeJsonObject;
	}

}
